home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavaboss.cog < prev    next >
Text File  |  1999-11-15  |  16KB  |  700 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBoss.cog
  4. #
  5. # AI enhancements for TEM Lava Boss
  6. #
  7. # [MDR]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. #    #####  COG Notes  #####
  12. #    The following functionality can be controlled with USER msgs sent to this COG
  13. #
  14. #    USER0 - Create Boss (param0 = Ghost THING used as position to be created at).
  15. #    USER1 - Reset Boss' height to normal.
  16. #    USER2 - Initialize Boss for play
  17. #    USER3 - Instantly teleport Boss to a GHOST pos
  18. #
  19. #
  20. #    #####  Programming Notes  #####
  21. #    n_AICustomMode usuage:
  22. #        0x02 - MODE_CAN_ATTACK
  23. #        0x04 - MODE_SUBMERGED
  24. #
  25. # ===================================================================
  26.  
  27. # ===================================================================
  28. symbols
  29.  
  30. message        removed
  31. message        entered
  32. message        timer
  33. message        pulse
  34. message        user0
  35. message        user1
  36. message        user2
  37. message        user3
  38.  
  39. # ************************** LINKED ITEMS **********************
  40. thing        t_trgr00
  41. thing        t_trgr01
  42. thing        t_trgr02
  43. thing        t_trgr03
  44. thing        t_trgr04
  45. thing        t_trgr05
  46. thing        t_trgr06
  47. thing        t_trgr07
  48. thing        t_trgr08
  49. thing        t_trgr09
  50. thing        t_trgr10
  51. thing        t_trgr11
  52. thing        t_trgr12
  53. thing        t_trgr13
  54. thing        t_trgr14
  55. thing        t_trgr15
  56. thing        t_trgr16
  57. thing        t_trgr17
  58. thing        t_trgr18
  59. thing        t_trgr19
  60. thing        t_trgr20
  61.  
  62. thing        t_ghostPos00
  63. thing        t_ghostPos01
  64. thing        t_ghostPos02
  65. thing        t_ghostPos03
  66. thing        t_ghostPos04
  67. thing        t_ghostPos05
  68. thing        t_ghostPos06
  69. thing        t_ghostPos07
  70. thing        t_ghostPos08
  71. thing        t_ghostPos09
  72. thing        t_ghostPos10
  73. thing        t_ghostPos11
  74. thing        t_ghostPos12
  75. thing        t_ghostPos13
  76. thing        t_ghostPos14
  77. thing        t_ghostPos15
  78.  
  79. surface        srf_trgr01                linkid=2
  80. surface        srf_trgr02                linkid=2
  81. surface        srf_trgr03                linkid=2
  82. surface        srf_trgr04                linkid=2
  83. surface        srf_trgr05                linkid=2
  84.  
  85. thing        t_ghostLookPos00
  86.  
  87. # ************************** TEMPLATES *************************
  88. template    tpl_Boss=lava_boss                    local
  89.  
  90. sound        mus_imp2=mus_gen_Machinepart.wav    local
  91. int            b_PlayedImpSND                        local
  92.  
  93. # ************************** MOVE VARS *************************
  94. int            n_idxStackTop                local
  95. thing        t_moveToPos00                local            
  96. thing        t_moveToPos01                local            
  97. thing        t_moveToPos02                local            
  98. thing        t_moveToPos03                local            
  99. thing        t_moveToPos04                local            
  100. thing        t_moveToPos05                local
  101. thing        t_moveToPos06                local
  102. thing        t_moveToPos07                local
  103.  
  104. int            n_idx                        local
  105. int            b_BossMoving                local
  106.  
  107. int            b_gotGuardTrgr                local
  108. int            b_hghtAdjust                local
  109. flex        f_upperHDelta                local
  110. flex        f_lowerHDelta                local
  111. flex        f_hghtStep                    local
  112.  
  113. thing        t_newPos                    local
  114. thing        t_param                        local
  115. thing        t_crntGoalPos                local
  116. thing        t_crntBossPos                local
  117.  
  118. thing        t_newTrig                    local
  119. thing        t_crntTrig                    local
  120.  
  121. flex        f_moveDelay                    local
  122.  
  123. # ************************** MISC LOCAL VARS *******************
  124. thing        t_boss                        local
  125. thing        t_player                    local
  126. thing        t_sender                    local
  127.  
  128. int            n_AICustomMode                local
  129. int            MODE_GUARDPOS=1                local
  130. int            MODE_CAN_ATTACK=2            local
  131. int            MODE_SUBMERGED=4            local
  132.  
  133. int            n_idTimer                    local
  134. int            TIMERID_SETHEIGHT=2            local
  135.  
  136. flex        f_val                        local
  137.  
  138. vector        vec_pos                        local
  139. vector        vec_dirA                    local
  140. vector        vec_dirB                    local
  141. sector        sec_atNewPos                local
  142.  
  143. vector        vec_insrtOffset                local
  144. vector        vec_crntOffset                local
  145. vector        vec_guardOffset                local
  146.  
  147. # ************************** SUBROUTINES *******************
  148. flex        ResetBossHeight                local
  149. flex        SubmergeBoss                local
  150. flex        SurfaceBoss                    local
  151. flex        InstantBossMove                local
  152. flex        SetBossGuardStance            local
  153. flex        SetMoveGoal                    local
  154. flex        GetMoveGoal                    local
  155.  
  156. end
  157.  
  158. # ===================================================================
  159. code
  160.  
  161. # ...................................................................
  162. removed:
  163.  
  164.     Reset();
  165.     KillTimerEx(TIMERID_SETHEIGHT);
  166.     SetPulse(0);
  167.     t_boss = -1;
  168.  
  169.     return;
  170.  
  171.  
  172. # ...................................................................
  173. entered:
  174.  
  175.     if ( t_boss == -1 )
  176.         return;
  177.  
  178.     t_sender = GetSourceRef();
  179.     if ( t_sender != t_player )
  180.         return;
  181.  
  182.     t_newTrig = GetSenderRef();
  183.     if ( t_newTrig == t_crntTrig )
  184.         return;
  185.  
  186.     b_gotGuardTrgr    = 0;
  187.  
  188.     if ( t_newTrig == t_trgr01 )
  189.     {
  190. #        DEBUGPRINT("Trigger 1  On Bridge");
  191.         b_gotGuardTrgr    = 1;
  192.         if ( b_PlayedImpSND == 0 )
  193.         {
  194.             if ( BITTEST(GetActorFlags(t_player), 0x80) )        # If player has AF_INVISIBLE
  195.             {
  196.                 b_PlayedImpSND = 1;
  197.                 PlaySoundLocal(mus_imp2, 1, 0, 0x0, 0);
  198.             }
  199.         }
  200.  
  201.         AIEnableInstinct(t_boss, "alternatefire", 0);
  202.         SetActorFlags(t_boss, 0xC00);                            # Set DEAF and BLIND while guarding
  203.         return;
  204.     }
  205.  
  206.     if ( (t_newTrig == t_trgr00) || (t_newTrig == t_trgr11) )
  207.     {
  208. #        DEBUGPRINT("Trigger 0 or 11  Pos 0 (guard pos)");
  209.         t_newPos        = t_ghostPos00;
  210.         b_gotGuardTrgr    = 1;
  211.  
  212.         n_AICustomMode = BITSET(n_AICustomMode, MODE_CAN_ATTACK | MODE_GUARDPOS);
  213.  
  214.         AIEnableInstinct(t_boss, "alternatefire", 0);
  215.         SetActorFlags(t_boss, 0xC00);                            # Set DEAF and BLIND while guarding
  216.     }
  217.  
  218.     if ( t_newTrig == t_trgr02 )
  219.     {
  220. #        DEBUGPRINT("Trigger 2  Pos 1");
  221.         t_newPos    = t_ghostPos01;
  222.     }
  223.     else if ( t_newTrig == t_trgr03 )
  224.     {
  225. #        DEBUGPRINT("Trigger 3  Pos 2");
  226.         t_newPos    = t_ghostPos02;
  227.     }
  228.     else if ( t_newTrig == t_trgr04 )
  229.     {
  230. #        DEBUGPRINT("Trigger 4  Pos 3");
  231.         t_newPos    = t_ghostPos03;
  232.     }
  233.     else if ( t_newTrig == t_trgr05 )
  234.     {
  235. #        DEBUGPRINT("Trigger 5  Pos 10");
  236.         t_newPos    = t_ghostPos10;
  237.     }
  238.     else if ( t_newTrig == t_trgr06 )
  239.     {
  240. #        DEBUGPRINT("Trigger 6  Pos 4");
  241.         t_newPos    = t_ghostPos04;
  242.     }
  243.     else if ( t_newTrig == t_trgr07 )
  244.     {
  245. #        DEBUGPRINT("Trigger 7  Pos 6");
  246.         t_newPos    = t_ghostPos06;
  247.     }
  248.     else if ( t_newTrig == t_trgr08 )
  249.     {
  250. #        DEBUGPRINT("Trigger 8  Pos 5");
  251.         t_newPos    = t_ghostPos05;
  252.     }
  253.     else if ( t_newTrig == t_trgr09 )
  254.     {
  255. #        DEBUGPRINT("Trigger 9  Pos 9");
  256.         t_newPos    = t_ghostPos09;
  257.     }
  258.     else if ( t_newTrig == t_trgr10 )
  259.     {
  260. #        DEBUGPRINT("Trigger 10  Pos 8");
  261.         t_newPos    = t_ghostPos08;
  262.     }
  263.  
  264.     if ( t_newTrig == srf_trgr01 )
  265.     {
  266.         if(GetInv(GetLocalPlayerThing(), 15) > 0)
  267.         {
  268. #            DEBUGPRINT("Srf Trigger 1  Pos 7");
  269.             t_newPos    = t_ghostPos07;
  270.         }
  271.     }
  272.     if ( t_newTrig == srf_trgr02 )
  273.     {
  274. #        DEBUGPRINT("Srf Trigger 2   No IMP2 = submerge");
  275.         if ( GetInv(GetLocalPlayerThing(), 15) == 0 )        # No IMP2 yet?
  276.         {
  277.             call SubmergeBoss;
  278.         }
  279.     }
  280.     if ( t_newTrig == srf_trgr03 )
  281.     {
  282.         if ( !BITTEST(n_AICustomMode, MODE_CAN_ATTACK) )
  283.             return;
  284.  
  285. #        DEBUGPRINT("Srf Trigger 3  Pos 11");
  286.         t_newPos    = t_ghostPos11;
  287.     }
  288.  
  289.     if ( t_newPos != t_crntBossPos )
  290.     {
  291.         t_crntTrig = t_newTrig;
  292.  
  293.         if ( b_gotGuardTrgr )
  294.         {
  295. #            DEBUGPRINT("Got guard trigger... teleporting boss.");
  296.             Reset();
  297.             t_crntGoalPos = t_newPos;
  298.             call InstantBossMove;
  299.             call SetBossGuardStance;
  300.  
  301.             return;
  302.         }
  303.  
  304.         AIEnableInstinct(t_boss, "alternatefire", 1);                        # Set defaults
  305.         ClearActorFlags(t_boss, 0xC00);                                        # Clear DEAF and BLIND
  306.         f_moveDelay = 1.0 + ((5 - GetDifficulty()) * 0.5);                    # Time influenced by Diff level
  307. #        DEBUGFLEX(f_moveDelay, "Set move delay =");
  308.  
  309.         n_AICustomMode = BITCLEAR(n_AICustomMode, MODE_GUARDPOS);
  310.         call SetMoveGoal;
  311.     }
  312.  
  313.     return;
  314.  
  315.  
  316. # ...................................................................
  317. pulse:
  318.  
  319.     if ( t_boss == -1 )
  320.     {
  321.         SetPulse(0);
  322.         return;
  323.     }
  324.  
  325.     if ( !b_BossMoving && !b_hghtAdjust )
  326.     {
  327.         if ( n_idxStackTop > -1 )
  328.         {
  329.             if ( f_moveDelay > 0 )
  330.             {
  331.                 f_moveDelay = f_moveDelay - 1.0;
  332. #                DEBUGFLEX(f_moveDelay, "Move delay =");
  333.                 return;
  334.             }
  335.  
  336.             b_BossMoving = 1;
  337.  
  338.             call GetMoveGoal;
  339.             if ( t_crntGoalPos > -1 )
  340.             {
  341. #                DEBUGPRINT("Moving boss");
  342.                 call SubmergeBoss;
  343.                 call SurfaceBoss;
  344.             }
  345.  
  346.             b_BossMoving = 0;
  347.         }
  348.  
  349.         if ( !BITTEST(n_AICustomMode, MODE_SUBMERGED) && !BITTEST(GetActorFlags(t_boss), 0xC00) )
  350.         {
  351.             if ( IsAITargetInSight(t_boss) )
  352.             {
  353. #                DEBUGPRINT("Setting standard height adjustment timer");
  354.                 f_val = VectorZ(GetThingPos(t_player)) - VectorZ(GetThingPos(t_boss));
  355.                 if ( f_val <= f_lowerHDelta || f_val >= f_upperHDelta )
  356.                 {
  357.                     SetTimerEx(0.03, TIMERID_SETHEIGHT, 0, 0);
  358.                 }
  359.             }
  360.         }
  361.     }
  362.  
  363.     if ( (t_crntBossPos == t_ghostPos00) && (t_crntTrig == t_trgr00 || t_crntTrig == t_trgr11) )
  364.     {
  365. #        DEBUGPRINT("Player at Boss guard pos");
  366.         SetActorFlags(t_boss, 0xC00);                                # Set DEAF and BLIND while guarding
  367.  
  368.         if ( b_hghtAdjust )
  369.             return;
  370.  
  371.         if ( BITTEST(GetActorFlags(t_player), 0x80) )                # If player is SITH_AF_INVISIBLE
  372.         {
  373.             if ( BITTEST(n_AICustomMode, MODE_SUBMERGED) )
  374.                 return;
  375.  
  376.             b_BossMoving = 1;
  377.             AISetLookThingEyeLevel(t_boss, t_ghostLookPos00);
  378.             call SubmergeBoss;
  379.             b_BossMoving = 0;
  380.         }
  381.         else
  382.         {
  383.             if ( !BITTEST(n_AICustomMode, MODE_SUBMERGED) )
  384.             {
  385.                 vec_dirA = VectorSub(GetThingPos(t_boss), GetThingPos(t_player));
  386. #                DEBUGFLEX(VectorLen(vec_dirA), "Guard dist to player =");
  387.  
  388.                 if ( VectorLen(vec_dirA) < 0.48 )
  389.                 {
  390. #                    DEBUGPRINT("Your dead... game over, man");
  391.                     StopThing(t_player);
  392.                     PlayMode(t_boss, 67, 0);
  393.                     DamageThing(t_player, 1000, 0x200, t_boss);        # Inflict SITH_DAMAGE_LAVA
  394.                 }
  395.  
  396.                 return;
  397.             }
  398.  
  399.             if ( b_BossMoving )
  400.                 return;
  401.  
  402.             b_BossMoving = 1;
  403.             t_crntGoalPos = t_ghostPos00;
  404.             call SurfaceBoss;
  405.             call SetBossGuardStance;
  406.             b_BossMoving = 0;
  407.         }
  408.     }
  409.  
  410.     return;
  411.  
  412.  
  413. # ...................................................................
  414. timer:
  415.  
  416.     if ( t_boss == -1 )
  417.         return;
  418.  
  419.     n_idTimer = GetSenderID();
  420.  
  421.     if ( n_idTimer == TIMERID_SETHEIGHT )                        #---- Match Player height
  422.     {
  423.         b_hghtAdjust = 0;
  424.  
  425.         if ( BITTEST(GetActorFlags(t_player), 0x80) )            # If player is SITH_AF_INVISIBLE, stop
  426.         {
  427.             call ResetBossHeight;
  428.             return;
  429.         }
  430.  
  431.         f_val = VectorZ(GetThingPos(t_player)) - VectorZ(GetThingPos(t_boss));
  432.         if ( (f_val > f_lowerHDelta) && (f_val < f_upperHDelta) )
  433.         {
  434. #            DEBUGPRINT("Boss at correct height... stopping check");
  435.             return;
  436.         }
  437.  
  438.         if ( f_val < f_lowerHDelta )
  439.         {
  440.             if ( VectorZ(vec_crntOffset) <= VectorZ(vec_insrtOffset) )
  441.             {
  442. #                DEBUGPRINT("Boss cant go any lower... stopping check");
  443.                 return;
  444.             }
  445.  
  446.             vec_dirA = VectorSet(0, 0, -f_hghtStep);
  447.         }
  448.         else
  449.         {
  450.             if ( VectorZ(vec_crntOffset) >= 0.7 )
  451.             {
  452. #                DEBUGPRINT("Boss cant go any higher... stopping check");
  453.                 return;
  454.             }
  455.  
  456.             vec_dirA = VectorSet(0, 0, f_hghtStep);
  457.         }
  458.  
  459.         b_hghtAdjust    = 1;
  460.         vec_dirB        = VectorAdd(vec_crntOffset, vec_dirA);
  461.         vec_crntOffset    = SetThingInsertOffset(t_boss, vec_dirB);
  462.         SetTimerEx(0.02, TIMERID_SETHEIGHT, 0, 0);
  463.  
  464. #        DEBUGFLEX(VectorZ(vec_dirB), "offset z=");
  465.     }
  466.  
  467.     return;
  468.  
  469.  
  470. # ...................................................................
  471. # Create a Lava Boss at location-THING == GetParam(0)            [must be a valid THING]
  472. user0:
  473.  
  474. #    DEBUGPRINT("Creating boss");
  475.  
  476.     t_player        = GetLocalPlayerThing();                    # set constants
  477.  
  478.     n_AICustomMode    = MODE_SUBMERGED;
  479.     f_upperHDelta    = -0.1;
  480.     f_lowerHDelta    = -0.18;
  481.     f_hghtStep        = 0.01;
  482.     b_PlayedImpSND    = 0;
  483.     f_moveDelay        = 0;
  484.     n_idxStackTop    = -1;
  485.     b_BossMoving    = 0;
  486.  
  487.     vec_guardOffset    = VectorSet(0, 0, 0.62);
  488.  
  489.     t_crntBossPos    = GetParam(0);
  490.     t_boss            = CreateThing(tpl_Boss, t_crntBossPos);
  491.     CaptureThing(t_boss);
  492.     ReturnEx(t_boss);                                            # Set Boss THING index for return to caller
  493.  
  494.     t_crntTrig        = -1;
  495.  
  496.     ClearThingFlags(t_boss, 0x80000);
  497.     AISetLookThing(t_boss, t_player);
  498.  
  499.     AISetCutsceneMode(t_Boss);
  500.  
  501.     vec_insrtOffset = GetThingInsertOffset(t_boss);
  502.     vec_crntOffset    = GetThingInsertOffset(t_boss);
  503.  
  504.     t_crntGoalPos    = t_crntBossPos;
  505.     call SurfaceBoss;
  506.  
  507.     return;
  508.  
  509.  
  510. # ...................................................................
  511. # Reset the Boss' height
  512. # ...................................................................
  513. user1:
  514.  
  515.     SetThingInsertOffset(t_boss, vec_insrtOffset);                # Put boss back at init insert offset
  516.  
  517.     return;
  518.  
  519.  
  520. # ...................................................................
  521. # Initialize Boss for play
  522. # ...................................................................
  523. user2:
  524.  
  525.     AIClearCutsceneMode(t_Boss);
  526.     SetPulse(1.0);
  527.  
  528.     call SubmergeBoss;
  529.  
  530.     return;
  531.  
  532.  
  533. # ...................................................................
  534. # Instantly teleport boss to a GHOST pos
  535. # ...................................................................
  536. user3:
  537.  
  538. #    DEBUGPRINT("Teleporting boss");
  539.     t_crntGoalPos = GetParam(0);
  540.     Reset();
  541.  
  542. # ...................................................................
  543. InstantBossMove:
  544.  
  545.     b_BossMoving    = 1;
  546.     n_idxStackTop    = -1;
  547.  
  548.     if ( GetThingType(t_crntGoalPos) == 8 )                        # Check for SITH_THING_GHOST
  549.     {
  550.         SetThingInsertOffset(t_boss, vec_insrtOffset);            # Put boss back at init insert offset
  551.  
  552.         n_AICustomMode = BITSET(n_AICustomMode, MODE_SUBMERGED);
  553.         call SurfaceBoss;
  554.     }
  555.     b_BossMoving    = 0;
  556.  
  557.     return;
  558.  
  559.  
  560. # ===================================================================
  561. #    Subroutines
  562. # ===================================================================
  563.  
  564. # ...................................................................
  565. ResetBossHeight:
  566.  
  567. #    DEBUGPRINT("Reset height begin");
  568.     b_hghtAdjust = 1;
  569.  
  570.     while ( VectorZ(vec_crntOffset) > VectorZ(vec_insrtOffset) )
  571.     {
  572.         vec_dirA        = VectorSet(0, 0, f_hghtStep);
  573.         vec_crntOffset    = SetThingInsertOffset(t_boss, VectorSub(vec_crntOffset, vec_dirA));
  574.  
  575.         if ( BITTEST(n_AICustomMode, MODE_SUBMERGED) )
  576.             return;
  577.  
  578.         Sleep(0.02);
  579.     }
  580.  
  581.     SetThingInsertOffset(t_boss, vec_insrtOffset);                # Put boss back at init insert offset
  582.  
  583.     b_hghtAdjust = 0;
  584. #    DEBUGPRINT("Reset height end");
  585.  
  586.     return;
  587.  
  588.  
  589. # ...................................................................
  590. SetBossGuardStance:
  591.  
  592. #    DEBUGPRINT("Set Guard height begin");
  593.     b_hghtAdjust = 1;
  594.  
  595.     SetActorFlags(t_boss, 0xC00);                                # Set DEAF and BLIND while guarding
  596.     AISetLookThingEyeLevel(t_boss, t_ghostPos01);
  597.  
  598.     while ( VectorZ(vec_crntOffset) < VectorZ(vec_guardOffset) )
  599.     {
  600.         vec_dirA        = VectorSet(0, 0, f_hghtStep);
  601.         vec_crntOffset    = SetThingInsertOffset(t_boss, VectorAdd(vec_crntOffset, vec_dirA));
  602.  
  603.         Sleep(0.02);
  604.     }
  605.  
  606.     SetThingInsertOffset(t_boss, vec_guardOffset);                # Put boss back at init insert offset
  607.  
  608.     b_hghtAdjust = 0;
  609. #    DEBUGPRINT("Set Guard height end");
  610.  
  611.     return;
  612.  
  613.  
  614. # ...................................................................
  615. SubmergeBoss:
  616.  
  617.     if ( BITTEST(n_AICustomMode, MODE_SUBMERGED) )
  618.     {
  619.         return;
  620.     }
  621.  
  622. #    DEBUGPRINT("Submerge begin");
  623.  
  624.     StopMode(t_boss, 68, 0.1);
  625.     SetActorFlags(t_boss, 0xC00);                                # Set DEAF and BLIND while submerging
  626.  
  627.     call ResetBossHeight;
  628.  
  629.     n_AICustomMode = BITSET(n_AICustomMode, MODE_SUBMERGED);
  630.     PlayMode(t_boss, 71, 1);                                    # play PUPPETADDIN_STAND2CRAWL
  631.     SetThingFlags(t_boss, 0x80000);
  632.  
  633. #    DEBUGPRINT("Submerge end");
  634.  
  635.     return;
  636.  
  637.  
  638. # ...................................................................
  639. SurfaceBoss:
  640.  
  641.     if ( !BITTEST(n_AICustomMode, MODE_SUBMERGED) )
  642.     {
  643.         return;
  644.     }
  645.  
  646. #    DEBUGPRINT("Surface begin");
  647.  
  648.     ClearThingFlags(t_boss, 0x80000);
  649.  
  650.     t_crntBossPos = t_crntGoalPos;
  651.     TeleportThing(t_boss, t_crntGoalPos);
  652.  
  653.     SendmessageEx(GetThingClassCog(t_boss), USER1, t_crntBossPos, 0, 0, 0);
  654.     PlayMode(t_boss, 72, 1);                                    # play PUPPETADDIN_CRAWL2STAND
  655.  
  656.     n_AICustomMode = BITCLEAR(n_AICustomMode, MODE_SUBMERGED);
  657.     ClearActorFlags(t_boss, 0xC00);                                # Clear DEAF and BLIND when surfaced
  658.     AISetLookThing(t_boss, GetLocalPlayerThing());
  659.  
  660. #    DEBUGPRINT("Surface end");
  661.  
  662.     return;
  663.  
  664.  
  665. # ...................................................................
  666. SetMoveGoal:
  667.  
  668.     n_idxStackTop = n_idxStackTop + 1;
  669.     t_moveToPos00[n_idxStackTop] = t_newPos;
  670.  
  671. #    DEBUGFLEX(n_idxStackTop, "PUSH:: Move stack size =");
  672.  
  673.     return;
  674.  
  675.  
  676. # ...................................................................
  677. GetMoveGoal:
  678.  
  679.     t_crntGoalPos = -1;
  680.  
  681.     if ( n_idxStackTop == -1 )
  682.         return;
  683.  
  684.     t_crntGoalPos = t_moveToPos00;
  685.  
  686.     for (n_idx=0; n_idx < n_idxStackTop; n_idx = n_idx + 1)
  687.     {
  688.         t_moveToPos00[n_idx] = t_moveToPos00[n_idx+1];
  689.     }
  690.  
  691.     n_idxStackTop = n_idxStackTop - 1;
  692. #    DEBUGFLEX(n_idxStackTop, "POP:: Move stack size =");
  693.  
  694.     return;
  695.  
  696.  
  697. # ===================================================================
  698. end
  699.  
  700.